<template>
  <a-modal
    :title="title"
    :width="800"
    :ok=false
    :visible="visible"
    :confirmLoading="confirmLoading"
    :okButtonProps="{ props: {disabled: disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">

    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="方案名称"
          prop="departName"
          :hidden="false"
          hasFeedback>
          <a-input id="departName" placeholder="请输入方案名称" v-model="model.programmeName"/>
        </a-form-model-item>
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="方案类别"
          :hidden="false"
          hasFeedback>
          <a-input id="departName" placeholder="请输入方案类别" v-model="model.programmeName"/>
        </a-form-model-item>
        <a-form-model-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="方案子类别"
          :hidden="false"
          hasFeedback>
          <a-input id="departName" placeholder="请输入方案子类别" v-model="model.programmeName"/>
        </a-form-model-item>
      </a-form-model>
    </a-spin>
  </a-modal>
</template>

<script>
  import ATextarea from 'ant-design-vue/es/input/TextArea'

  export default {
    name: "ProgrammeModal",
    components: {ATextarea},
    data() {
      return {
        departTree: [],
        orgTypeData: [],
        phoneWarning: '',
        departName: "",
        title: "新建",
        // seen:false,
        visible: false,
        disableSubmit: false,
        model: {},
        defaultModel: {
          departOrder: 0
          // orgCategory:'1'
        },
        labelCol: {
          xs: {span: 24},
          sm: {span: 5},
        },
        wrapperCol: {
          xs: {span: 24},
          sm: {span: 16},
        },

        confirmLoading: false,
        validatorRules: {
          departName: [{required: true, message: '请输入方案名称!'}],
        },
        url: {
        },
      }
    },
    created() {
    },
    methods: {
      add() {
        this.model = {}
        this.visible = true;
      },
      edit(record) {
        this.visible = true;
        this.model = Object.assign({}, this.defaultModel, record)
        this.model.parentId = record != null ? record.parentId.toString() : null;
      },
      close() {
        this.$emit('close');
        this.disableSubmit = false;
        this.visible = false;
        this.$refs.form.resetFields();
      },
      handleCancel() {
        this.close()
      }
    }
  }
</script>

<style scoped>

</style>